const { DataTypes } = require('sequelize')

const seq = require('../db/seq')

const Course = seq.define(
  'test_course',
  {
    course_name: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: '课程名称'
    },
    course_price: {
      type: DataTypes.DECIMAL(10, 2),
      allowNull: false,
      comment: '课程价格'
    },
    course_tearch: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: '课程讲师'
    },
    course_img: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: '课程图片地址'
    }
  },
  {
    tableName: 'test_course1'
  }
)

//Course.sync({ force: true })

module.exports = Course
